function PromoterActivityDynamicRange_Blue(mTurq2, SCFP3A)
%GETAUTOCORRELATION Summary of this function goes here
%   Detailed explanation goes here

%% Load colonies
% TurqBleach = LoadColonySet('TurBleach', 'all');
% SCFPBleach = LoadColonySet('SCFPBleach', 'all');

df_averCell = [];
nCellSCFP = 0;
for j=1:length(SCFP3A)
    
    cell = SCFP3A{j}.cell;
    for i=1:length(cell)
        if strcmp(cell(i).fate, 'd')
            df = cell(i).flscnc.df;
            df = df(~isnan(df));
            df_averCell = [df_averCell mean(df)];
            nCellSCFP = nCellSCFP + 1;
        end
    end
end
df_averCell = sort(df_averCell);
infLimFast = df_averCell(floor(0.01*length(df_averCell)));
supLimFast = df_averCell(ceil(0.99*length(df_averCell)));
rangeSCFP = supLimFast - infLimFast;

x = 0:100:4000;
[d_SCFP, c_SCFP] = hist(df_averCell, x);
d_SCFP = d_SCFP/sum(d_SCFP(:));

%% Load mTurq2 colony
df_averCell = [];
nCellTurq = 0;
for j=1:length(mTurq2)

    if j==3; continue, end;
    cell = mTurq2{j}.cell;
    for i=1:length(cell)
        if strcmp(cell(i).fate, 'd')
            df = cell(i).flscnc.dfFilt;
            df = df(~isnan(df));
            df_averCell = [df_averCell median(df)];
            nCellTurq = nCellTurq + 1;            
        end
    end
end
df_averCell = sort(df_averCell);
df_averCell = df_averCell(1:end-1);
infLimSlow = df_averCell(floor(0.01*length(df_averCell)));
supLimSlow = df_averCell(ceil(0.99*length(df_averCell)));
rangeTurq = supLimSlow - infLimSlow;

rangeSCFP/rangeTurq
nCellTurq
nCellSCFP

[d_mTurq, c_mTurq] = hist(df_averCell, x);
d_mTurq = d_mTurq/sum(d_mTurq(:));

%% 1st Figure 
figure_h = figure('Color', [1 1 1]);
plot(c_mTurq, d_mTurq, '-', 'LineWidth', 4, 'Color', [3 146 178]/255)
hold on;

xlim([-200 4000]);
ylim([0 0.175]);
ylabel('\fontsize{20}Frequency');
xlabel('\fontsize{20}Fluorescence Production Rate \rm(au\rm)');

set(gca,'box','off')
isholdonque = ishold; 
hold on 
ax = axis; 
plot(ax(2)*[1,1],ax(3:4),'k','linewidth',0.5) 
plot(ax(1:2),ax(4)*[1,1],'k','linewidth',0.5) 
if isholdonque == 0 
hold off 
end

factor = 0.14;
set(gca, 'FontSize', 16);
line([infLimFast supLimFast],[1 1]*1.1*factor, 'linewidth', 4, 'Color', [58 219 255]/255)
str1 = {'98% Dynamic Range Coverage'};
text(0, 1.175*factor, str1, 'FontSize', 14, 'HorizontalAlignment', 'left')
str1 = {'Fast FP'};
text(2800, 1.11*factor, str1, 'FontSize', 16, 'HorizontalAlignment', 'left')

plot(c_SCFP, d_SCFP, '-', 'LineWidth', 4, 'Color', [58 219 255]/255)

line([infLimSlow supLimSlow],[1 1]*1.040*factor, 'linewidth', 4, 'Color', ([3 146 178])/255)
str1 = {'Slow FP'};
text(2100, 1.015*factor, str1, 'FontSize', 16, 'HorizontalAlignment', 'left')


%% 2nd Fig
figLog_h = figure('Color', [1 1 1]);
plot(c_mTurq, d_mTurq, '-', 'LineWidth', 4, 'Color', [3 146 178]/255)
hold on
plot(c_SCFP, d_SCFP, '-', 'LineWidth', 4, 'Color', [58 219 255]/255)

xlim([-50 3000]);
ylim([0 0.175]);
ylabel('\fontsize{20}Frequency');
xlabel('\fontsize{20}Fluorescence Production Rate \rm(au\rm)');

set(gca, 'YScale', 'log');
set(gca, 'FontSize', 16);

str1 = {'98% Dynamic Range Coverage'};
text(380, .00097, str1, 'FontSize', 15, 'HorizontalAlignment', 'left')

str1 = {'Slow FP'};
text(480, 0.0057, str1, 'FontSize', 20, 'HorizontalAlignment', 'left')
line([infLimSlow supLimSlow],[1 1]*0.004, 'linewidth', 4, 'Color', [3 146 178]/255)

str1 = {'Fast FP'};
text(800, 0.0019, str1, 'FontSize', 20, 'HorizontalAlignment', 'left')
line([infLimFast supLimFast],[1 1]*0.0013, 'linewidth', 4, 'Color', [58 219 255]/255)

end
